In certain applications, for example in the domain of video, a mass storage device, or external memory, stores data for processing by a processor of a data processing device according to a given algorithm. The data can be stored in this memory in a format which differs from the data format supported by the processor.
In particular, the data stored in external memory can correspond to information on chrominance and luminance. Video images are conventionally encoded using such information. To convert a video signal into chrominance data and luminance data, the signal is sampled. Then chrominance and/or luminance data are associated with all or part of the samples depending on the encoding used for the image.
Different encoding formats are conventionally used. For example, the terms “4:2:2” and “4:2:0” designate different encoding formats which are conventionally used, with each describing a different structure for a digital image. The term 4:2:2 indicates that the chrominance is horizontally subsampled by a factor of two relative to the luminance. The term 4:2:0 signifies that the chrominance is horizontally and vertically subsampled by a factor of two relative to the luminance. The stored data vary not only as a function of the encoding of the video image, which provides more or less luminance data and chrominance data for a video image, but also as a function of the storage method (also called the storage format) used for the encoded data. Chrominance and luminance data can successively alternate in memory in the order of the pixels of an image, or can be stored separately (with the chrominance data in one place and the luminance data in another).
To retrieve data from external memory, it is conventional to use a DMA (Direct Memory Access) device. A DMA device enables direct data transfers between an external memory and an internal memory that is associated with the processor without requiring the intervention of the microprocessor, with some exceptions, such as when initiating and concluding a data transfer.
Generally, the processor processes video data representing the respective locations of the pixels which form the video images.
The data is stored at respective addresses in the external memory. Then, for the requirements of the processing applied by the processor to the data, the data is requested via the DMA device as a function of the location of the pixels with which it is associated, generally meaning as a function of the spatial coordinates of the different pixels in the images.
For some of the processing applied by the processor, the processor may request the retrieval of certain data from external memory via the DMA device without knowing the format of the data stored in the external memory. Therefore the processor may not be able to indicate to the DMA device the memory address or addresses corresponding to the data being requested.
In such conditions, the DMA device is responsible for translating the information received in a data request from the processing device into an address based on the storage format in external memory. To perform such a translation and retrieve the requested data from the external memory, a fixed rule of correspondence is generally determined in the DMA device, establishing a correspondence between the information received in the request and an address in the external memory.
More specifically, in a conventional architecture using a DMA device, the DMA device is in charge of determining a block of data to be retrieved from external memory, and cooperates with an interface module connected to it. This module is more specifically in charge of determining the different addresses of the data contained in the block of data to be retrieved. Architecturally, determining the addresses of the data to be retrieved therefore corresponds to a first step having a first level of granularity which allows determining a block of data to be retrieved, with this first step being implemented by the DMA device, and a second step having a second level of granularity which allows determining the addresses of the data contained in the block of data, with this second step being implemented in the interface module.
An interface module operates on the basis of a rule of correspondence, which is fixed because it is directly linked to a given storage method. When a DMA device is responsible for retrieving blocks of data corresponding to different storage formats, several modules are coupled to that DMA device, with each corresponding to one of the different storage formats.
It is therefore difficult to adapt a DMA device to different storage formats in external memory.